package team.seekers.catering.common.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import lombok.Getter;

import java.util.Arrays;

/**
 * 饮食意向枚举
 */
@Getter
public enum FoodPackageTypeEnum implements IEnum<Integer> {


    BIG(0, "轻食套餐","完整套餐盒"),
    MID_LOW(1,  "轻食简餐","中餐盒+小碗"),
    MID(3, "控卡单品","大碗"),
    LOW(4, "增肌单品","小碗"),

    ;

    private int type;

    private String name;

    private String amount;

    FoodPackageTypeEnum(int type, String name, String amount) {
        this.type = type;
        this.name = name;
        this.amount = amount;
    }

    @Override
    public Integer getValue() {
        return this.type;
    }

    public static FoodPackageTypeEnum getByType(int type) {
        return Arrays.stream(values()).filter(e -> e.getType() == type).findFirst().orElse(null);
    }

    public static FoodPackageTypeEnum getByName(String name) {
        return Arrays.stream(values()).filter(e -> e.getName().equals(name)).findFirst().orElse(null);
    }
}
